package crm.modefy2;

import java.util.Scanner;
/**
 * 控制台文件，处理整个操作的逻辑
 * @author ZHUAN4
 *
 */
public class Consolo {
	
	static Data<CustomerM> d=new Data<CustomerM>();
	static DataHandle<CustomerM> dh=new DataHandle<CustomerM>();
    static CommandHandle cd=new CommandHandle();
    static DealCommand   dc= new DealCommand();
    static String command="";
    static String commandKind="";
	public static void main(String[] args) throws Exception {
	dh.initCRM(InitialDataModefied.initialData(),d);
		/**
		 * 初始界面
		 */
		System.out.println("····················································");
		System.out.println("·            Wlecome to oocl CRM!                  ·");
		System.out.println("·                input 'HELP' to see help document!·");
		System.out.println("····················································");
		System.out.println();
		Scanner input=new Scanner(System.in);
		do{
			System.out.println("·············Please input your command··············");
			command="";
		    commandKind="";
		    command=input.nextLine();
		    commandKind=cd.commandHandle(command);   //调用命令解析器，来解析代码
		    String[] strCommand=command.split(" ");
		    dc.dealCommand(d,dh, commandKind, strCommand, input);
		}while(true);
	}

}
